package cn.inurl.gui;

import java.awt.BorderLayout;
import java.awt.FlowLayout;

import javax.swing.JButton;
import javax.swing.JDialog;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.JLabel;
import javax.swing.JCheckBox;
import javax.swing.JComboBox;
import javax.swing.DefaultComboBoxModel;
import javax.swing.JTextField;

import cn.inurl.res.Messages;

public class SettingDomainDlg extends JDialog {

	private static final long serialVersionUID = 1L;
	private final JPanel contentPanel = new JPanel();
	private JTextField txtPassword;
	private JTextField txtKeywords;

	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		try {
			SettingDomainDlg dialog = new SettingDomainDlg();
			dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
			dialog.setVisible(true);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	/**
	 * Create the dialog.
	 */
	public SettingDomainDlg() {
		setTitle(Messages.getString("SettingDomainDlg.frame.title")); //$NON-NLS-1$
		setBounds(100, 100, 354, 235);
		getContentPane().setLayout(new BorderLayout());
		contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
		getContentPane().add(contentPanel, BorderLayout.CENTER);
		contentPanel.setLayout(null);
		
		JLabel lblKeywords = new JLabel(Messages.getString("SettingDomainDlg.txtKeywords.text")); //$NON-NLS-1$
		lblKeywords.setBounds(10, 10, 66, 15);
		contentPanel.add(lblKeywords);
		
		JLabel lblSuffix = new JLabel(Messages.getString("SettingDomainDlg.txtSuffix.text")); //$NON-NLS-1$
		lblSuffix.setBounds(10, 35, 66, 15);
		contentPanel.add(lblSuffix);
		
		JCheckBox chckbxcn = new JCheckBox(Messages.getString("SettingDomainDlg.chckbxcn.text")); //$NON-NLS-1$
		chckbxcn.setBounds(10, 81, 54, 23);
		contentPanel.add(chckbxcn);
		
		JCheckBox chckbxcomcn = new JCheckBox(Messages.getString("SettingDomainDlg.chckbxcomcn.text")); //$NON-NLS-1$
		chckbxcomcn.setBounds(66, 81, 76, 23);
		contentPanel.add(chckbxcomcn);
		
		JCheckBox chckbxnetcn = new JCheckBox(Messages.getString("SettingDomainDlg.chckbxnetcn.text")); //$NON-NLS-1$
		chckbxnetcn.setBounds(163, 81, 76, 23);
		contentPanel.add(chckbxnetcn);
		
		JCheckBox chckbxorgcn = new JCheckBox(Messages.getString("SettingDomainDlg.chckbxorgcn.text")); //$NON-NLS-1$
		chckbxorgcn.setBounds(262, 81, 103, 23);
		contentPanel.add(chckbxorgcn);
		
		JCheckBox chckbxcom = new JCheckBox(Messages.getString("SettingDomainDlg.chckbxcom.text")); //$NON-NLS-1$
		chckbxcom.setBounds(10, 56, 54, 23);
		contentPanel.add(chckbxcom);
		
		JCheckBox chckbxnet = new JCheckBox(Messages.getString("SettingDomainDlg.chckbxnet.text")); //$NON-NLS-1$
		chckbxnet.setBounds(66, 56, 61, 23);
		contentPanel.add(chckbxnet);
		
		JCheckBox chckbxorg = new JCheckBox(Messages.getString("SettingDomainDlg.chckbxorg.text")); //$NON-NLS-1$
		chckbxorg.setBounds(163, 56, 61, 23);
		contentPanel.add(chckbxorg);
		
		JCheckBox chckbxcc = new JCheckBox(Messages.getString("SettingDomainDlg.chckbxcc.text")); //$NON-NLS-1$
		chckbxcc.setBounds(262, 56, 54, 23);
		contentPanel.add(chckbxcc);
		
		JLabel lblPeriods = new JLabel(Messages.getString("SettingDomainDlg.lblPeriods.text")); //$NON-NLS-1$
		lblPeriods.setBounds(10, 110, 66, 15);
		contentPanel.add(lblPeriods);
		
		JComboBox cmbPeriods = new JComboBox();
		cmbPeriods.setModel(new DefaultComboBoxModel(new String[] {"1\u5E74", "2\u5E74", "3\u5E74", "4\u5E74", "5\u5E74"}));
		cmbPeriods.setBounds(76, 107, 61, 21);
		contentPanel.add(cmbPeriods);
		
		JLabel lblPassword = new JLabel(Messages.getString("SettingDomainDlg.lblPassword.text")); //$NON-NLS-1$
		lblPassword.setBounds(10, 135, 66, 15);
		contentPanel.add(lblPassword);
		
		txtPassword = new JTextField();
		txtPassword.setBounds(76, 132, 252, 21);
		contentPanel.add(txtPassword);
		txtPassword.setColumns(10);
		
		txtKeywords = new JTextField();
		txtKeywords.setBounds(76, 7, 252, 21);
		contentPanel.add(txtKeywords);
		txtKeywords.setColumns(10);
		{
			JPanel buttonPane = new JPanel();
			buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT));
			getContentPane().add(buttonPane, BorderLayout.SOUTH);
			{
				JButton btnSave = new JButton(Messages.getString("SettingDomainDlg.btnSave.text")); //$NON-NLS-1$
				btnSave.setActionCommand(Messages.getString("SettingDomainDlg.btnSave.actionCommand")); //$NON-NLS-1$
				buttonPane.add(btnSave);
				getRootPane().setDefaultButton(btnSave);
			}
			{
				JButton btnCancel = new JButton(Messages.getString("SettingDomainDlg.btnCancel.text")); //$NON-NLS-1$
				btnCancel.setActionCommand(Messages.getString("SettingDomainDlg.btnCancel.actionCommand")); //$NON-NLS-1$
				buttonPane.add(btnCancel);
			}
		}
	}
}
